package com.miku.blog.controller;

import com.miku.blog.annotation.SystemLog;
import com.miku.blog.domain.dto.WebsiteInfoDTO;
import com.miku.blog.domain.pojo.ResponseResult;
import com.miku.blog.service.WebsiteInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author shkstart
 * @create ${}YEAR-06-17 5:47
 */
@Api(tags = "后台管理系统[博客信息更新]")
@RequestMapping("/admin")
@RestController
public class WebSiteInfoAdminController {


    @Autowired
    private WebsiteInfoService websiteInfoService;


    @SystemLog(notes = "修改系统公告")
    @ApiOperation(value = "修改系统公告接口")
    @PutMapping("/notice")
    public ResponseResult addNotice(String notice){
        return websiteInfoService.editNotice(notice);
    }


    @SystemLog(notes = "编辑[关于我]的内容")
    @ApiOperation(value = "编辑[关于我]的内容接口")
    @PutMapping("/about")
    public ResponseResult editAbout(@RequestBody WebsiteInfoDTO websiteInfoDTO){
        return websiteInfoService.editAbout(websiteInfoDTO);
    }

}
